package day06;

import java.util.Scanner;

//方法的演示
public class MethodDemo {
    public static void main(String[] args) {

        say();
        System.out.println("继续执行");
        sayHi("sc");
        sayHello("sc",66);
        sayHello("yyy",23);
        double a=getNum();
        System.out.println(a);
        int e =plus(5,55);
        e++;
        System.out.println(e);
        Scanner scan=new Scanner(System.in);
        int m1=(int)(Math.random()*100);
        int m2=(int)(Math.random()*100);
        int d=plus(m1,m2);
        System.out.println(m1);
        System.out.println(m2);
        System.out.println(d);
        int[] c=testArray(5,1,100);
        System.out.println("数组的长度为："+c.length);
//
        int[] f=testArray(20,0,100);
        System.out.println("数组的第一个值为："+f [0]);
        for(int i=0;i<f.length;i++){
            System.out.println(f[i]);
        }
        sayHello("we",24);
        sayHello("aa",80);

        aMethod();
        System.out.println(444);


    }

    public  static  void aMethod(){
        System.out.println(111);
        bMethod();
        System.out.println(333);
    }

    public static void bMethod(){
        System.out.println(222);
    }

    public static int[] testArray(int len,int min,int max){
        int []arr=new int[len];
        for(int i=min;i<arr.length;i++){
            arr[i]=(int)(Math.random()*(max+1));
        }
        return arr;
    }

    public static int plus(int num1,int num2){

        int num=num1+num2;

        return num;
    }

    public static double getNum(){
        return 5.0;
    }


    public static void sayHello(String name,int age){
        if(age>60){
            return;
        }
        System.out.println("大家好，我叫"+name+",今年"+age+"岁了");
    }


    public static void sayHi(String name){
        System.out.println("大家好，我叫"+name+",今年24岁了");
    }


    public static void say(){
        System.out.println("欢乐斗地主");
    }
}
